<div class="row"">
<div class="col-md-2">
    <?php include(dirname(dirname(__FILE__)).'/sidebar.phtml');?>
</div>
<div class="col-md-10">
  <form class="form-inline task" action="/manage/user/invitelist/" method = "GET">
    <div class="form-group">
      <label class="control-label">师傅UID</label>
      <input class="form-control" name="parent_id" type="text" placeholder="师傅UID" value="<?php if(!empty($params['parent_id'])): echo $params['parent_id']; endif;?>">
    </div>
    <div class="form-group">
      <label class="control-label">徒弟UID</label>
      <input class="form-control" name="uid" type="text" placeholder="徒弟UID" value="<?php if(!empty($params['uid'])): echo $params['uid']; endif;?>">
    </div>
    <div class="form-group">
      <label class="control-label">注册日期</label>
      <input class="form-control" name="start_date" type="text" autocomplete="off" id="startTime" value="<?php if(!empty($params['start_date'])):?><?php echo $params['start_date'];?> <?php endif;?>">
      至
      <input class="form-control" name="end_date" type="text" autocomplete="off" id="endTime" value="<?php if(!empty($params['end_date'])):?><?php echo $params['end_date'];?> <?php endif;?>">
    </div>
    <button type="submit" class="btn btn-default btn-gap">搜索</button>
  </form>
  <div class="panel panel-default">
    <div class="panel-heading clearfix">
      邀请列表
    </div>
    <div class="panel-body">
      <table class="table table-bordered table-striped">
        <thead>
          <tr>
            <th scope="col">师傅UID</th>
            <th scope="col">徒弟UID</th>
            <th scope="col">手机号</th>
            <th scope="col">注册时间</th>
            <th scope="col">IP</th>
            <th scope="col">微信头像</th>
            <th scope="col">昵称</th>
            <th scope="col">获得分红</th>
          </tr>
        </thead>
        <tbody>
          <?php foreach ($rowsets as $id => $row):?>
            <tr>
              <td scope="row"><a href="/manage/user/invitelist/?parent_id=<?php echo $row['parent_id']?>"><?php if(!empty($row['parent_id'])){echo $row['parent_id'];}?></a></td>
              <td><a href="/manage/user/invitelist/?uid=<?php echo $row['uid']?>"><?php if(!empty($row['uid'])){echo $row['uid'];}?></a></td>
              <td><?php echo $row['mobile']?></td>
              <td><?php echo date("Y-m-d H:i:s", $row['regtime'])?></td>
              <td><?php echo $row['remote_ip']?></td>
              <td>
                <div>
                  <img src="<?php echo $row['avatar']?>" class="avatar" />
                </div>
              </td>
              <td><?php echo base64_decode($row['nickname'])?></td>
              <td><?php echo $row['bonus_parant']?></td>
            </tr>
          <?php endforeach;?>
        </tbody>
      </table>
      <?php $pager->render();?>
    </div>
    <a href="/manage/user/invitelistoutput/?<?php echo http_build_query($params) ?>"  class="btn btn-success">导出Excel文件</a>
  </div>
</div>
<script type="text/javascript">
$( document ).ready(function() {
  $("#startTime").datetimepicker({format:"Y-m-d H:i:00"});
  $("#endTime").datetimepicker({format:"Y-m-d H:59:59"});
});
</script>